<?php
/*! \brief
 * This is WFSoapFactory class
 * This is the Simple Factory Class that create relative Soap Class
 * \author William Su
 */
class WFSoapFactory
{
    /**
     * @return WF
     */
    private $objFramework;
    private static $instance;
    public function __construct($objFramework){
        $this->objFramework = $objFramework;
    }
    public static function getDirnameFile(){
        if(! isset(self::$instance[__FUNCTION__])){
            self::$instance[__FUNCTION__] = dirname(__FILE__);
        }
        return self::$instance[__FUNCTION__];
    }
    /**
     * @return SoapClient
     */
    public function getSoapClient($strWsdl, $arrOptions = array()){
        if(! isset(self::$instance[__FUNCTION__])){
            require_once self::getDirnameFile() . '/SoapClient.php';
        }
        self::$instance[__FUNCTION__] = new WFSoapClient($strWsdl, $arrOptions);
        return self::$instance[__FUNCTION__];
    }
}